import request from '../../utils/request'
import config from '../../config'

export default {
  // 获取页面表格数据
  async getPageListArea(params){
    return await request({url:'/factoryArea/factoryAreas',params})
  },
  // 新增区域
  async saveArea(data){
    return await request({url:'/factoryArea/save',method:'post',data})
  },
  // 更新区域
  async updateArea(data){
    return await request({url:'/factoryArea/update',method:'post',data})
  },
  // 获取区域下拉数据
  async getAreaNameDown(){
    return await request({url:'/factoryArea/getAllAreaNames'})
  },
  // 根据区域id获取相应的信息
  async getAreaInfo(params){
    return await request({url:'/factoryArea/factoryAreaInfo',params})
  },

  // 获取厂信息
  async getFactoryInfo(){
    return await request({url:'/factory/factoryInfo'})
  },
  // 厂信息保存
  async saveFactorInfo(data){
    return await request({url:'factory/update',method:'post',data})
  },

  // 删除区域
  async deleteArea(params){
    return await request({url:'/factoryArea/delete',method:'post',data:params})
  },


  // 设备管理

  // 获取页面表格数据
  async getPageListDevice(params){
    return await request({url:'/device/devices',params})
  },
  // 新增设备
  async saveDevice(data){
    return await request({url:'device/save',method:'post',data})
  },
  // 更新设备
  async updateDevice(data){
    return await request({url:'device/update',method:'post',data})
  },
  // 获取设备名称下拉数据
  async getDeviceNameDownDevice(){
    return await request({url:'/device/getDeviceNames'})
  },
  // 获取设备区域下拉数据
  async getDeviceAreaNameDownDevice(){
    return await request({url:'/factoryArea/getAllAreas'})
  },
  // 获取设备类型下拉数据
  async getDeviceTypeNameDownDevice(){
    return await request({url:'/device/getDeviceTypes'})
  },
  // 根据设备Id获取相应的信息
  async getDeviceInfoDevice(params){
    return await request({url:'/device/deviceInfo',params})
  },
  // 删除设备
  async deleteDevice(data){
    return await request({url:'/device/delete',method:'post',data})
  }


}
